<template>
    <!--尺寸-->
    <div class="role">
        <a-card>
            <div class="table">
                <Tables
                    ref="table"
                    :columns="columns"
                    :loadData="findSizeList"
                    :addData="addSize"
                    :editData="editSize"
                    :delData="delSize"
                    :formColumns="formColumns"
                >
                    <template slot="id" slot-scope="{ text }">
                        <span>{{ text }}</span>
                    </template>
                    <template slot="createTime" slot-scope="{ text }">
                        <span>{{ text | moment }}</span>
                    </template>
                </Tables>
            </div>
        </a-card>
    </div>
</template>

<script>
import rules from '@/validate/role'
import { addSize, findSizeList, delSize, editSize } from '@/api/size'

export default {
    name: 'SizeList',
    data() {
        return {
            columns: [
                {
                    dataIndex: 'name',
                    title: '名称',
                    align: 'center'
                },
                {
                    dataIndex: 'createTime',
                    title: '创建时间',
                    align: 'center',
                    scopedSlots: { customRender: 'createTime' }
                }
            ],
            formColumns: {
                name: {
                    type: 'input',
                    label: '名称'
                },
                id: {
                    type: 'hidden'
                }
            },
            visible: false,
            delVisible: false,
            edit: false,
            title: '新增',
            rules: rules,
            form: {},
            checkOptions: [],
            routes: [],
            findSizeList,
            addSize,
            editSize,
            delSize
        }
    },
    created() {},
    methods: {}
}
</script>

<style scoped></style>
